/**
 * @Project TMHSCFX
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Apr 14, 2011
 * @Createtime 10:25:46 AM
 */

package com.tmh.study.fAS3AMTM.chap4
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.filters.BlurFilter;

	public class Filters extends Sprite
	{
		public function Filters()
		{
			super();
			addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
		}

		private function addedToStageHandler(event:Event):void
		{
			initData();
		}

		private function initData():void
		{
			var sprite:Sprite = new Sprite();
			sprite.graphics.lineStyle(2);
			sprite.graphics.beginFill(0xffff00);
			sprite.graphics.drawRect(100, 100, 100, 100);
			sprite.graphics.endFill()
			addChild(sprite);

			var blur:BlurFilter = new BlurFilter(5, 5, 3);
			var filters:Array = new Array();

			filters.push(blur);

			sprite.filters = filters;
		}
	}
}